<?php
/**
 * Created by JetBrains PhpStorm.
 * User: patch
 * Date: 17.10.12
 * Time: 16:22
 * To change this template use File | Settings | File Templates.
 */
?>

<div id="<?php print $element['#field_name']; ?>" class="carousel slide" xmlns="http://www.w3.org/1999/html">
  <div class="carousel-inner">

    <?php  foreach($items as $key => $image) : ?>
<!--    --><?php //$url = file_create_url($image['#item']['uri']); ?>

    <?php $active = $key == 0 ? 'active' : ''; ?>
    <div class="item field-item <?php print $active; ?>">

     <?php print theme('image_formatter', $image); ?>
      <!--                    <div class="carousel-caption">-->
      <!--                      <h4>First Thumbnail label</h4>-->
      <!--                      <p>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</p>-->
      <!--                    </div>-->
    </div>
    <?php endforeach; ?>

  </div>

  <?php if(sizeof($items) > 1) : ?>
  <a class="carousel-control left"  href="#<?php print $element['#field_name']; ?>" data-slide="prev">&lsaquo;</a>
  <a class="carousel-control right" href="#<?php print $element['#field_name']; ?>" data-slide="next">&rsaquo;</a>
  <?php endif; ?>

</div>
